﻿using B.MES.Customer.Domain;
using B.MES.Customer.Domain.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace B.MES.Customer.Infrastructure.IRepository
{
    public interface IRoleRepository:IBaseRepository<Role>
    {
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="role">需要添加的角色</param>
        /// <returns>受影响的行数</returns>
        APIResult<RoleDTO> AddRole(RoleDTO role);
        /// <summary>
        /// 删除单个角色
        /// </summary>
        /// <param name="roleId">角色Id</param>
        /// <returns>受影响的行数</returns>
        APIResult<Role> DeleteRole(int roleId);
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        APIResult<List<Role>> BatchDeleteRoles(List<Role> list);
        /// <summary>
        /// 添加角色和权限ID
        /// </summary>
        /// <param name="rolePermissionDTO">角色权限</param>
        /// <returns>角色权限的数据</returns>
        APIResult<RolePermissionDTO> AddRolePermission(RolePermissionDTO rolePermissionDTO);
        /// <summary>
        /// 根据角色ID 获取对应的权限ID
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        PageApiResut<string> GetRoleIdByPermissionIds(string roleId);
        /// <summary>
        /// 修改角色信息
        /// </summary>
        /// <param name="role">角色信息</param>
        /// <returns>受影响的行数</returns>
        APIResult<Role> UpdateRole(Role role);

        /// <summary>
        /// 获取角色信息
        /// </summary>
        /// <returns></returns>
        PageApiResut<Role> GetRole();
    }

    public record RolePermissionDTO(string RoleId,string Permssions);
}
